package ch.trackedbean.client.resources;

import java.util.*;

public class Messages {
    private static ResourceBundle BUNDLE = ResourceBundle.getBundle("ch.trackedbean.client.resources.messages");

    public static final String NAME = getValue("name");

    public static final String FIRST_NAME = getValue("firstName");

    public static final String AGE = getValue("age");

    public static final String ADDRESS = getValue("address");

    public static final String PERSON_LIST_VIEW = getValue("person.list.view");

    public static final String PERSON_DETAIL_VIEW = getValue("person.detail.view");

    public static final String ADDRESS_STREET = getValue("address.street");

    public static final String ADDRESS_STREET_NR = getValue("address.street.nr");

    public static final String ADDRESS_CITY = getValue("address.city");

    public static final String ADDRESS_COUNTRY = getValue("address.country");

    private static String getValue(String key) {
        try {
            return BUNDLE.getString(key);
        } catch (MissingResourceException e) {
            return "!" + key;
        }
    }
}